/**
 * @Author: Caven
 * @Date: 2020-03-19 22:35:48
 */
import Vue from 'vue'
import './utils/rem.js' //在main.js中引入rem.js
import appLoader from './App.Loader'

import '@/fonts/HanYi/hanyi.css'
import maxLengthTip from './directives/maxLengthTip.js'
import onlyNumber from './directives/onlyNumber.js'
import noSpace from './directives/noSpace.js'
import vSelectPage from 'v-selectpage';

Vue.prototype.$bus = new Vue()
Vue.directive('max-length-tip', maxLengthTip)
Vue.directive('only-number', onlyNumber)
Vue.directive('no-space', noSpace)
Vue.use(vSelectPage, {
  language: 'cn',
  dataLoad: function (vue, data, params) {
    return new Promise((resolve, reject) => {
      // axios.get(data, params).then(resp => resolve(resp), resp => reject(resp))
      resolve([])
    })
  },
});
; (async () => {
  await appLoader.install()

  Promise.all([
    import('./App.vue'),
    import('./router'),
    import('./store')
  ]).then(([{ default: App }, { default: router }, { default: store }]) => {
    new Vue({
      el: '#app',
      router,
      store,
      render: h => h(App)
    })
  })
})()
